import http from "../utils/request"

//获取验证码
export const getCaptcha = () => http.get('/users/getCaptcha?v=next')

//校验验证码
export const verifyCaptcha = (captcha) => http.get('/users/verifyCaptcha', {
    // headers: {
    //     "lilei": "hanmeimei"
    // },
    params: {
        captcha
    }
})

//获取手机验证码
export const getSmsCaptcha = (phoneNumber) => http.post("/sms/send", { phoneNumber },
    // {
    //     headers: {
    //         "lilei": "hanmeimei"
    //     }
    // }
)

//手机登录
export const smsLogin = code => http.post("/users/login?type=sms", { code })

//用户名登录
export const commonLogin = (username, password) => http.post("/users/login", { username, password })

//获取二维码url
export const getQrcode = sid => http.get("/users/getQrcode", {
    params: {
        sid
    }
})
//微信登录
export const wechatLogin = wechatCode => http.get("/users/wechatLogin", {
    params: {
        wechatCode
    }
})

// axios config模式 发送请求
export const getWeather = () => http({
    url: "/weather/getWeather",
    // method: "get",
    // params: {
    //     city: "东莞"
    // },

    //    hhhhhhh   //

    // method: "post",
    // data: {
    //     city: "东莞"
    // }
})